home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 …ember: Reference Library / Dev.CD Dec 94.toast / Technical Documentation / Mac Tech Notes (DocViewer) / HW • Hardware / HW24 Little PowerBook Sleep / HW24 Little PowerBook Sleep
Encoding:
Text File  |  1994-10-19  |  20.7 KB  |  17 lines  |  [ONLN/HLX2]

  1. HW 24 - Little PowerBook in Slumberland
  2. Hardware    
  3. Written by:    Dennis Hescox and Blake Roberts    October 1992
  4. The purpose of this Note is to describe the ramifications of resting, sleeping, and power-saving modes in the PowerBook family of Macintosh computers, how they may affect your application, and the appropriate ways to defeat them, when appropriate. It also describes some nonintuitive ramifications of working with a battery-powered computer.
  5. The Power Manager
  6. In each PowerBook is a separate processor called the Power Manager. Its function is to monitor and control the power consumption and battery charging of the system. In doing this, it turns on and off various hardware subsystems, changes or stops the CPU’s clock speed, watches the battery voltage, and, when charging, sets the bulk charge or trickle charge modes of the battery charging circuit. As you can see, the power draw of the system is a dynamically changing value, depending on which subsystems are currently in use, the speed of the processor, and whether or not charger circuit power is available. The Power Manager is designed to optimize for the maximum battery life and controls the various operating modes in response to user preferences that allow the user to override or push back in time the onset of these modes.
  7. The Many Faces of the Power Manager
  8. The PowerBook 100 (just like the original portable) has four operating modes: normal, rest, sleep, and shutdown.
  9. The PowerBook 140 has four operating modes: normal, rest (power cycling), sleep, and shutdown.
  10. The PowerBook 170 has five operating modes: normal, powersaver, rest (power cycling), sleep, and shutdown.
  11. • Normal Mode:
  12. In the normal operating mode the CPU is running at its full clock speed. There is no interface associated with running in this mode.
  13. PowerBook 100 and 140: 16 MHz
  14. PowerBook 170: 25 MHz
  15. • Powersaver Mode:
  16. PowerBook 100 and 140: This mode is not available.
  17. PowerBook 170: This mode can be turned on and off from the Battery desk accessory. When powersaver mode is on, the clock speed is reduced from its normal 25 MHz to a less power consumptive 16 MHz.
  18. • Rest Mode:
  19. After a period of inactivity, the Power Manager will put the system into a rest mode.
  20. Activity is defined as:
  21. • Any call to Read or Write (any I/O activity)
  22. • Having an ADB Completion Routine called (moving the mouse or hitting a key on the keyboard, for instance)
  23. • Any call to Post Event
  24. • Any call to OSEventAvail
  25. • Any sound generation
  26. • Any call to SetCursor with a new cursor (setting the same cursor does nothing)
  27. Rest will also not be entered if the cursor is set to the system Watch cursor.
  28. PowerBook 100: After 15 seconds of inactivity the Power Manager slows the processor clock down to an effective 1 MHz by inserting wait states. 
  29. A program can reset the 15-second countdown by calling IdleUpdate and can turn the countdown off and on with DisableIdle and EnableIdle. IdleUpdate is the preferred method. From the Finder the user can disable rest mode by Option-clicking the text in the Portable control panel device that says “Minutes Until Automatic Sleep.” This brings up a dialog box that allows you to set “Rest” and “Don’t Rest.” Permanently disabling rest mode will reduce your battery’s available operating time between charging.
  30. PowerBook 140 and 170: This mode is implemented by using a power-saving method called power cycling. Power cycling reduces the CPU power draw by up to 90 percent during idle periods. Power cycling will start after 2 seconds when there is no user or input/output activity (screen updates do not count as I/O activity) as outlined above in rest mode. The CPU is then turned off. After a short break ,on the order of 1/2 to 3/4 second, the CPU power is restored. The system checks to see if any activity conditions have been met; if so, power cycling is stopped. If there is no activity, the power cycling time increases a small amount, up to a few seconds. The CPU will stay off for the power cycling duration or until an interrupt comes in.
  31. Power cycling works as follows. The registers of the 68030 and the 68882 are saved, and power to them is turned off if no input activity is detected. The power cycle consists of turning the power to the CPU off and stopping the CPU clock, and then restoring power to the CPU after the varying wait period. When power is back on, the CPU registers are restored and the CPU monitors the system for activity.
  32. • Sleep Mode:
  33. PowerBook 100, 140, and 170: This mode stops processing by bringing the CPU clock to 0 MHz and turning off power to all subsystems except RAM memory and the Power Manager. Before entering and after leaving sleep mode, the system calls entries in the Sleep Queue to allow drivers and other processes to prepare for loss of power and the resetting of devices after power is restored.
  34. Sleep mode can be prevented by checking the box labeled “Stay awake when plugged in” in the Portable control panel device and having the charger adapter of the PowerBook plugged in.
  35. • Shutdown Mode:
  36. PowerBook 100: Shutdown mode for the 100 is identical to sleep mode except that the operating system software must reboot before continuing. 
  37. PowerBook 140 and 170: Shutdown mode for 140 and 170 is the same as turning the power off on any other (nontransportable) Macintosh. All subsystems are off except that there is a vary small drain on the battery to maintain parameter RAM settings.
  38. Defeating the Rest Mode Is Not Recommended
  39. Regardless of the power source, the PowerBook is designed always to draw its power needs from the battery, not directly from an AC outlet. Because of this power architecture, the battery charge is constantly fluctuating. If the hardware power needs are met, the remaining voltage from the power adapter will trickle charge the battery. It is important to keep in mind that depending on use, the PowerBook may require the entire available power, not allowing for the battery to charge at all. For the PowerBook to recharge fully, the unit must be in either sleep or shutdown mode. One of the primary considerations in the design of the PowerBook 170 was power conservation. If the unit is running with the rest mode defeated, there is a possibility that charging will take longer than you might expect or you will actually drain your, or your custormers, battery or your custormers. This is because the Power Adapter is intended for battery charging and cannot accommodate the needs of a 68030 processor running at 100 percent speed and a hard disk running 100 percent of the time.
  40. Further Reference:
  41. •    Inside Macintosh, Volume VI, Power Manager
  42. •    Macintosh PowerBook Family Developer Notes
  43. &HRˇ ˇˇˇˇRH°d WORDS †å°d WORDR…†Ç
  44. /ZÅ#
  45.     0Ià:µú9"{    ˇˇˇˇˇˇˇˇ#†ƒ°d
  46. ONLNf˛†å°d1drw2…-·_ġˇˇˇˇˇè°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˙ó@†ò,Times
  47. .WIQkWIQk+]BNew Technical Notes†ô°ddrw2:°„†ó°d1drw2eÙġˇˇˇˇˇP°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˚ÄE¿†ò
  48. Ä({ïDeveloper Support†ô°ddrw2:°„†ó°d`drw2-ÔˇˇˇˇˇˇKÔ- Z  ffZ°d1drw2 ¿˙ÈˇˇˇˇˇˇK°ñ x°ddrw2:°ddrw2:$°d4drw2:0°öˇÙĆò
  49. 0(UÔ†ô°ddrw2:°„†ó°d1drw2ÔÊ˙ˇˇˇˇˇˇ°ñ x°ddrw2:°ddrw2:$°d4drw2:    °öˇ˝Ä†ò
  50.     l+&    ®†ô°ddrw2:°„†ó°d1drw2Â-¯yˇˇˇˇˇˇ°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˚Ä%†ò
  51. BÄ(Z\    Macintosh†ô°ddrw2:°„†ó†ç°ddrw2D†É°dWORD†ç
  52. HR.°dONLNdéZ°ª(úZ'HW 24 - Little PowerBook in Slumberland
  53. °dONLNd(†ZØö*Hardware
  54. °dONLNd2ªZ«è* Written by:°dONLNd>ª¢«D)HDennis Hescox and Blake Roberts°dONLNd^ª‹«(ƒ‹ October 1992°dONLNdk”Zfl€(‹ZTThe purpose of this Note is to describe the ramifications of resting, sleeping, and °dONLNdø”€fl(‹€ power-saving°dONLNdÃflZÎè(ËZ6modes in the PowerBook family of Macintosh computers, °dONLNdflèÎ(Ëèhow they may affect your°dONLNdÎZ˜V(ÙZ6application, and the appropriate ways to defeat them, °dONLNdQÎV˜)¸(when appropriate. It also describes some°dONLNdz˜Z≠(ZFnonintuitive ramifications of working with a battery-powered computer. X
  55. °dONLNd¡(Z7‡*4The Power Manager
  56. °dONLNd”CZOŒ*In each PowerBook is °dONLNdËCŒO)tAa separate processor called the Power Manager. Its function is to°dONLNd*OZ[@(XZ.monitor and control the power consumption and °dONLNdXO@[)Ê.battery charging of the system. In doing this,°dONLNdá[Zg(dZ%it turns on and off various hardware °dONLNd¨[g)¥3subsystems, changes or stops the CPU’s clock speed,°dONLNd‡gZs¯(pZ"watches the battery voltage, and, °dONLNdg¯s)û;when charging, sets the bulk charge or trickle charge modes°dONLNd>sZ9(|Z1of the battery charging circuit. As you can see, °dONLNdos9)fl-the power draw of the system is a dynamically°dONLNdùZãõ(àZ<changing value, depending on which subsystems are currently °dONLNdŸõã(àõin use, the speed of the°dONLNdÚãZó“(îZprocessor, and whether °dONLNd    ã“ó)x?or not charger circuit power is available. The Power Manager is°dONLNdIóZ£5(†Z-designed to optimize for the maximum battery °dONLNdvó5£)€0life and controls the various operating modes in°dONLNdߣZØá(¨Z    response °dONLNd∞£áØ)-Uto user preferences that allow the user to override or push back in time the onset of°dONLNdØZªò(∏Z these modes.°dONLNd«Z”7*#The Many Faces of the Power Manager°dONLNd7flZÎÖ*=The PowerBook 100 (just like the original portable) has four °dONLNdtflÖÎ(ËÖoperating modes: normal, rest,°dONLNdìÎZ˜¿(ÙZsleep, and shutdown.°dONLNd®Z€*The PowerBook 140 has °dONLNdæ€)Å>four operating modes: normal, rest (power cycling), sleep, and°dONLNd˝Zç(Z    shutdown.°dONLNd'Z3 *EThe PowerBook 170 has five operating modes: normal, powersaver, rest °dONLNdL' 3(0 (power cycling),°dONLNd]3Z?¿(<Zsleep, and shutdown.
  57. °dONLNdrKZW®*• Normal Mode:
  58. °dONLNdÅbZn˘*!In the normal operating mode the °dONLNd¢b˘n)ü=CPU is running at its full clock speed. There is no interface°dONLNd‡nZz (wZ%associated with running in this mode.°dONLNdÜZí˛*PowerBook 100 and 140: 16 MHz°dONLNd$ûZ™’*PowerBook 170: 25 MHz ΩXΩ
  59. *.'HW 24 - Little PowerBook in Slumberland(’1) of 3(ÎZHardwareˇ°¿Ù%%DSIDICT:_cv
  60. currentdict /bu known {bu}if
  61. userdict /_cv known not{userdict /_cv 30 dict put}if
  62. _cv begin
  63. /bdf{bind def}bind def
  64. currentscreen/cs exch def/ca exch def/cf exch def
  65. /setcmykcolor where{/setcmykcolor get /cvcmyk exch def}{/cvcmyk{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdf }ifelse
  66. /ss{//cf //ca //cs setscreen}bdf
  67. /stg{ss setgray}bdf
  68. /strgb{ss setrgbcolor}bdf
  69. /stcmyk{ss cvcmyk}bdf
  70. /min1{dup 0 eq{pop 1}if}bdf
  71. end
  72. currentdict /bn known {bn}if
  73. †øzHRˇ ˇˇˇˇRH
  74. HR,Times
  75. .+6-Macintosh Technical Notes /4/˘°dONLNdH6Tó*$• Powersaver Mode:
  76. °dONLNd_6k2*2PowerBook 100 and 140: This mode is not available.°dONLNdFw6ɇ* PowerBook 170: This mode can be °dONLNdfw‡É¯)™7turned on and off from the Battery desk accessory. When°dONLNdûÉ6è√(å6Npowersaver mode is on, the clock speed is reduced from its normal 25 MHz to a °dONLNdÏÉ√è¯(å√
  77. less power°dONLNd˜è6õ†(ò6consumptive 16 MHz.
  78. °dONLNd ß6≥v* • Rest Mode:
  79. °dONLNdæ6 √*UAfter a period of inactivity, the Power Manager will put the system into a rest mode.°dONLNdn÷6‚ú*Activity is defined as:°dONLNdÜÓ6˙*.• Any call to Read or Write (any I/O activity)°dONLNdµ˙6˙* #• Having an ADB Completion Routine °dONLNdÿ˙˙¯)ƒ0called (moving the mouse or hitting a key on the°dONLNd    6§(6keyboard, for instance)°dONLNd!6¶* • Any call to Post Event°dONLNd:6*∂* • Any call to OSEventAvail°dONLNdU*66•* • Any sound generation°dONLNdl66B≤* P• Any call to SetCursor with a new cursor (setting the same cursor does nothing)°dONLNdΩN6Zô*NRest will also not be entered if the cursor is set to the system Watch cursor.°dONLNd f6rÍ*#PowerBook 100: After 15 seconds of °dONLNd/fÍr¯)¥6inactivity the Power Manager slows the processor clock°dONLNdfr6~-({64down to an effective 1 MHz by inserting wait states.°dONLNdúä6ñ§*A program can reset °dONLNd∞ä§ñ¯)n>the 15-second countdown by calling IdleUpdate and can turn the°dONLNdÔñ6¢
  80. (ü6*countdown off and on with DisableIdle and °dONLNdñ
  81. ¢¯)◊/EnableIdle. IdleUpdate is the preferred method.°dONLNdI¢6Æ—(´6RFrom the Finder the user can disable rest mode by Option-clicking the text in the °dONLNdõ¢—Ư(´—Portable°dONLNd§Æ6∫©(∑6Lcontrol panel device that says “Minutes Until Automatic Sleep.” This brings °dONLNdÆ©∫¯(∑©up a dialog box°dONLNd∫6Δ£(√6Kthat allows you to set “Rest” and “Don’t Rest.” Permanently disabling rest °dONLNdK∫£Δ¬(√£mode °dONLNdP∫¬Δ‘)will°dONLNdT∫‘Δ¯) reduce°dONLNd\Δ6“D(œ69your battery’s available operating time between charging.°dONLNdñfi6Í›*OPowerBook 140 and 170: This mode is implemented by using a power-saving method °dONLNdÂfi›Í¯(Á›called°dONLNdÏÍ6ˆú(Û6Dpower cycling. Power cycling reduces the CPU power draw by up to 90 °dONLNd0Íúˆ¯(Ûúpercent during idle°dONLNdDˆ6Ù(ˇ6*periods. Power cycling will start after 2 °dONLNdnˆÙ¯)æ6seconds when there is no user or input/output activity°dONLNd•6Õ( 6 (screen updates do not count as °dONLNd≈Õ¯)ó=I/O activity) as outlined above in rest mode. The CPU is then°dONLNd6Î(6(turned off. After a short break ,on the °dONLNd+ί)µ6order of 1/2 to 3/4 second, the CPU power is restored.°dONLNdb6&q(#6 The system °dONLNdmq&¯);Ochecks to see if any activity conditions have been met; if so, power cycling is°dONLNdΩ&62m(/6 stopped. If °dONLNd…&m2¯)7Rthere is no activity, the power cycling time increases a small amount, up to a few°dONLNd26>Ì(;6]seconds. The CPU will stay off for the power cycling duration or until an interrupt comes in.°dONLNdzJ6V€* Power cycling works as follows. °dONLNdöJ€V¯)•7The registers of the 68030 and the 68882 are saved, and°dONLNd“V6b`(_6Bpower to them is turned off if no input activity is detected. The °dONLNd    V`b¯(_`power cycle consists of turning°dONLNd    4b6nÖ(k6the power to the °dONLNd    EbÖn¯)OGCPU off and stopping the CPU clock, and then restoring power to the CPU°dONLNd    çn6zù(w6after the varying wait °dONLNd    §nùz¯)gEperiod. When power is back on, the CPU registers are restored and the°dONLNd    Íz6ÜÍ(É6%CPU monitors the system for activity.
  82. °dONLNd
  83. í6û{*
  84. • Sleep Mode: Ω4Ω˘*:2) of 3(’KHW 24 - )&Little PowerBook in Slumberland+cHardwareˇHRˇ ˇˇˇˇRH
  85. HR,Times
  86. .+Z-Developer Support Center(-Ê October 1992 /X/
  87. °dONLNd<ZHØ(EZPowerBook 100, °dONLNd<ØH)UG140, and 170: This mode stops processing by bringing the CPU clock to 0°dONLNdWHZTâ(QZMHz and °dONLNd_HâT)/Lturning off power to all subsystems except RAM memory and the Power Manager.°dONLNd¨TZ`L(]Z2Before entering and after leaving sleep mode, the °dONLNdfiTL`)Ú*system calls entries in the Sleep Queue to°dONLNd    `Zl“(iZQallow drivers and other processes to prepare for loss of power and the resetting °dONLNdZ`“l(i“of devices after°dONLNdklZx∞(uZpower is restored.°dONLNd~ÑZê*USleep mode can be prevented by checking the box labeled “Stay awake when plugged in” °dONLNd”Ñê(çin the°dONLNd⁄êZú(ôZYPortable control panel device and having the charger adapter of the PowerBook plugged in.
  88. °dONLNd4®Z¥¥*• Shutdown Mode:
  89. °dONLNdEøZÀ*PPowerBook 100: Shutdown mode for the 100 is identical to sleep mode except that °dONLNdïøÀ(»the°dONLNdôÀZ◊k(‘Z8operating system software must reboot before continuing.°dONLNd”„ZÔø*PowerBook 140 and °dONLNd„øÔ)eC170: Shutdown mode for 140 and 170 is the same as turning the power°dONLNd)ÔZ˚S(¯Z3off on any other (nontransportable) Macintosh. All °dONLNd\ÔS˚)˘)subsystems are off except that there is a°dONLNdÜ˚Zô(ZCvary small drain on the battery to maintain parameter RAM settings.°dONLNd Zb**Defeating the Rest Mode Is Not Recommended°dONLNdı+Z7û*Regardless of °dONLNd+û7)DJthe power source, the PowerBook is designed always to draw its power needs°dONLNdN7ZC¨(@ZHfrom the battery, not directly from an AC outlet. Because of this power °dONLNdñ7¨C(@¨architecture, the battery°dONLNd∞CZOÜ(LZ>charge is constantly fluctuating. If the hardware power needs °dONLNdÓCÜO(LÜare met, the remaining voltage°dONLNd
  90. OZ[ (XZXfrom the power adapter will trickle charge the battery. It is important to keep in mind °dONLNdeO [(X that°dONLNdj[Zgñ(dZAdepending on use, the PowerBook may require the entire available °dONLNd´[ñg(dñpower, not allowing for the°dONLNd«gZsÀ(pZPbattery to charge at all. For the PowerBook to recharge fully, the unit must be °dONLNdgÀs(pÀin either sleep or°dONLNd*sZ√(|Zshutdown mode. One °dONLNd=s√)iDof the primary considerations in the design of the PowerBook 170 was°dONLNdÇZã (àZ_power conservation. If the unit is running with the rest mode defeated, there is a possibility °dONLNd· ã(à that°dONLNdÊãZó*(îZ)charging will take longer than you might °dONLNdã*ó)–/expect or you will actually drain your, or your°dONLNd?óZ£ñ(†Z custormers, °dONLNdKóñ£)<Mbattery or your custormers. This is because the Power Adapter is intended for°dONLNdô£ZØn(¨Z5battery charging and cannot accommodate the needs of °dONLNdŒ£nØ(¨n a 68030 processor running at 100°dONLNdÔØZªÄ(∏Z>percent speed and a hard disk running 100 percent of the time.°dONLNd.flZ΃*0Further Reference: ÎXΰdONLNdAÏl¯p+
  91. •°dONLNdCÏ~¯œ)Inside Macintosh°dONLNdSÏœ¯\)Q, Volume VI, Power Manager°dONLNdn¯lp(l•°dONLNdp¯~a)*Macintosh PowerBook Family Developer Notes ΩXΩ
  92. (’Z'HW 24 - Little PowerBook in Slumberland(’3) of 3(ÎZHardwareˇ